﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Knlght.Model.Sys;
using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations.Schema;

namespace Knlght.Mappings
{
    public class SysRoleInfoMapping : EntityTypeConfiguration<RoleInfo>
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public SysRoleInfoMapping()
        {
            // 设置表名
            this.ToTable("Sys"+nameof(RoleInfo));
            //设置主键
            this.HasKey(a => a.Id);
            //不更新
            this.Property(t => t.AddTime).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Computed);
            // 设置属性的类型和长度
            this.Property(a => a.Name).HasColumnType("NVarchar").HasMaxLength(200);

        }
    }
}
